<?php
/**
 * oscshop2 B2C电子商务系统
 *
 * ==========================================================================
 * @link      http://www.oscshop.cn/
 * @copyright Copyright (c) 2015-2017 oscshop.cn. 
 * @license   http://www.oscshop.cn/license.html License
 * ==========================================================================
 *
 * @author    李梓钿
 * 团购余额支付
 */
 
namespace osc\payment\controller;
use osc\common\controller\Base;
use think\Db;
class TuanPredeposit extends Base{
	
	//团购下单处理
	public function process($id){
		
		$service=osc_service('common','Tuan');
		
		$order=$service->add_order($id,session('shipping_address_id'),session('payment_method'));
		
		if(isset($order['error'])){
			return array('error'=>$order['error']);
		}else{
			
			osc_service('common','Tuan')->clear_cart($order['uid']);			
			osc_order()->update_order($order['order_id']);			
			osc_service('common','Predeposit')->update_predeposit($order);		
				
			return array('url'=>url('/pay_success'));
		}
		
	}
	


}
